package com.hah.steamDemo.demo;

import com.hah.steamDemo.entiy.StudentInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class text1 {
    public static void main(String[] args) {
        List<StudentInfo> studentList = new ArrayList<>();
        studentList.add(new StudentInfo("小明",15,"男","中国石油大学"));
        studentList.add(new StudentInfo("小红",12,"女","中国海洋大学"));
        studentList.add(new StudentInfo("小绿",14,"男","山东大学"));
        studentList.add(new StudentInfo("小蓝",17,"男","烟台大学"));

        List<StudentInfo> student =  studentList.stream().filter(s->s.getName().equals("小明") ||
                s.getName().equals("小蓝")).collect(Collectors.toList());
        for (StudentInfo studentInfo : student) {
            System.out.println("studentInfo = " + studentInfo);
        }
//        System.out.println("student = " + student.toString());
    }
}
